<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="layui/css/layui.css"  media="all">
    <script src="js/0_common/jquery.min.js"></script>
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
    <style>
        .layui-input{
            border-color: #ffffff;

        }
        .fgsq .layui-form-select .layui-input {
            padding-right: 0 !important;
        }
        .ylbt {
            cursor: pointer;
        }
        #img-previewer-container {
            width: 100%;
            height: 100%;
        }
        #img-preview {
            width: 100%;
            height: 100%;
        }
    </style>
    <script src="lib/viewer.js"></script>
    <link rel="stylesheet" href="lib/viewer.css">
</head>
<body class="fgsq">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>企业复工复产服务详情</legend>
</fieldset>

<form class="layui-form" action="" lay-filter="form-test" id="example" method="post">
<div class="layui-form-item">
    <div class="" style="width: 783px;">
        <label class="layui-form-label">企业名称</label>
        <div class="layui-input-block">
            <input type="text" id="zd2" name="zd2" lay-verify="title" autocomplete="off" placeholder="请输入企业名称" class="layui-input">
        </div>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">企业统一社会信用代码</label>
        <div class="layui-input-block">
            <input type="text" name="zd1" lay-verify="content" autocomplete="off" placeholder="请输入企业统一社会信用代码" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">单位地址</label>
        <div class="layui-input-block">
            <input type="text" id="zd4" name="zd4" lay-verify="title" autocomplete="off" placeholder="请输入单位地址" class="layui-input">
        </div>
    </div>
</div>

<div class="layui-form-item">
    <div class="layui-inline" style="display: none">
        <label class="layui-form-label">所属区县</label>
        <div class="layui-input-block">
            <input type="text" id="zd3" name="zd3" lay-verify="title" autocomplete="off" placeholder="请输入所属区县" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">所属街道</label>
        <div class="layui-input-block">
            <input type="text" id="zd22" name="zd22" lay-verify="title" autocomplete="off" placeholder="请输入所属街道" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">是否个体工商户</label>
        <div class="layui-input-block">
            <div style="width: 182px;">
                <input type="radio" name="zd54" value="是" title="是">
                <input type="radio" name="zd54" value="否" title="否" checked>
            </div>
        </div>
    </div>

</div>
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">法人代表</label>
        <div class="layui-input-block">
            <input type="text" id="zd5" name="zd5" lay-verify="title" autocomplete="off" placeholder="请输入法人代表" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">法人联系方式</label>
        <div class="layui-input-block">
            <input type="text" id="zd6" name="zd6" lay-verify="phone" autocomplete="off" placeholder="请输入手机号" class="layui-input">
        </div>
    </div>
</div>

<!--    新增字段-->
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">企业所有制</label>
        <div class="layui-input-block">
            <select name="zd50" lay-verify="required">
                <option value=""></option>
                <option value="0">国有企业</option>
                <option value="1">民营企业</option>
                <option value="2">外资及港澳台企业</option>
            </select>
        </div>
    </div>

    <div class="layui-inline">
        <label class="layui-form-label">所属行业</label>
        <div class="layui-input-block">
            <select name="zd51" lay-verify="required">
                <option value=""></option>
                <option value="0">农、林、牧、渔业</option>
                <option value="1">采矿业</option>
                <option value="2">制造业</option>
                <option value="3">电力、热力、燃气及水生产和供应业</option>
                <option value="4">建筑业</option>
                <option value="5">批发和零售业</option>
                <option value="6">交通运输、仓储和邮政业</option>
                <option value="7">住宿和餐饮业</option>
                <option value="8">信息传输、软件和信息技术服务业</option>
                <option value="9">金融业</option>
                <option value="10">房地产业</option>
                <option value="11">租赁和商务服务业</option>
                <option value="12">科学研究和技术服务业</option>
                <option value="13">水利、环境和公共设施管理业</option>
                <option value="14">居民服务、修理和其他服务业</option>
                <option value="15">教育</option>
                <option value="16">卫生和社会工作</option>
                <option value="17">文化、体育和娱乐业</option>
                <option value="18">公共管理、社会保障和社会组织</option>
                <option value="19">国际组织</option>
            </select>
        </div>
    </div>
</div>

<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">24小时值班人员</label>
        <div class="layui-input-block">
            <input type="text" id="zd52" name="zd52" lay-verify="title" autocomplete="off" placeholder="请输入24小时值班人员" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">值班人员联系方式</label>
        <div class="layui-input-block">
            <input type="text" id="zd53" name="zd53" lay-verify="phone" autocomplete="off" placeholder="请输入值班人员联系方式" class="layui-input">
        </div>
    </div>
</div>

<div class="layui-form-item">
    <div class="layui-inline"  style="display: none">
        <label class="layui-form-label">所属楼宇、产业园</label>
        <div class="layui-input-block">
            <input  type="text" id="zd56" name="zd56" autocomplete="off" placeholder="所属楼宇、产业园(非楼宇、产业园内企业不用选择)" class="layui-input"/>
            (非楼宇、产业园内企业不用选择)
        </div>
    </div>
</div>

<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">员工总数</label>
        <div class="layui-input-block">
            <input type="text" id="zd58" name="zd58" lay-verify="title" autocomplete="off" placeholder="请输入员工总数" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">复工原因</label>
        <div class="layui-input-block">
            <select name="zd57" lay-verify="required">
                <option value=""></option>
                <option value="0">公共事业运行必需</option>
                <option value="1">疫情防控必需</option>
                <option value="2">群众生活必需</option>
                <option value="3">重要国计民生</option>
                <option value="4">春节期间未停产</option>
                <option value="5">特殊原因申请提前复工</option>
                <option value="6">2月9日后正常复工</option>
            </select>
        </div>
    </div>
</div>

<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">外地返苏人数</label>
        <div class="layui-input-block">
            <input type="text" name="zd64" lay-verify="title" autocomplete="off" placeholder="请输入外地返苏人数" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">疫情防控重点地区员工数</label>
        <div class="layui-input-block">
            <input type="text" name="zd59" lay-verify="title" autocomplete="off" placeholder="请输入疫情防控重点地区员工数" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <span id="ggyqyg" style="display: inline-block">!</span>
    </div>
</div>

<div class="layui-form-item">
    <div id="ggyqwz" style="width: 604px;margin-left: 200px;display: none">
        <div class="layui-inline">
            <span  style="color: #6f6f6f">备注重点区域的清单（湖北全省各市、浙江省温州市、台州市、杭州市、宁波市、河南省信阳市、驻马店市、安徽省合肥市、阜阳市、江西省南昌市）</span>
        </div>
    </div>
    <!--<div style="width: 774px;">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea name="zd60" placeholder="" class="layui-textarea"></textarea>
        </div>
    </div>-->
</div>

<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">申请复工人数</label>
        <div class="layui-input-block">
            <input type="text" name="zd61" lay-verify="title" autocomplete="off" placeholder="请输入申请复工人数" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">疫情防控重点地区复工人数</label>
        <div class="layui-input-block">
            <input type="text" name="zd62" lay-verify="title" autocomplete="off" placeholder="请输入疫情防控重点地区复工人数" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <span id="ggyqfk" style="display: inline-block">!</span>
    </div>
</div>

<div class="layui-form-item">
    <div id="ggyqfkwz" style="width: 604px;margin-left: 200px;display: none">
        <div class="layui-inline">
            <span  style="color: #6f6f6f">备注重点区域的清单（湖北全省各市、浙江省温州市、台州市、杭州市、宁波市、河南省信阳市、驻马店市、安徽省合肥市、阜阳市、江西省南昌市）</span>
        </div>
    </div>
    <!--<div style="width: 774px;">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea name="zd63" placeholder="" class="layui-textarea"></textarea>
        </div>
    </div>-->
</div>

<div class="layui-form-item">
    <label class="layui-form-label">疫情防控情况</label>
    <div style="width: 774px;">
        <input type="checkbox" name="zd65" title="疫情防控体系建设已到位">
        <input type="checkbox" name="zd66" title="职工统计分类管理已到位">
        <input type="checkbox" name="zd67" title="应急防控物资保障已到位">
        <input type="checkbox" name="zd68" title="疫情防控场所准备已到位">
    </div>
</div>
<!--    新增结束-->

</div>
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">复工日期</label>
        <div class="layui-input-block">
            <input type="text" name="zd11" lay-verify="title" autocomplete="off"  class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">填报日期</label>
        <div class="layui-input-block">
            <input type="text" name="zd12" lay-verify="title" autocomplete="off"  class="layui-input">
        </div>
    </div>
</div>

    <div class="layui-form-item">
        <label class="layui-form-label">复工服务表</label>
        <div class="layui-input-block">
            <input type="text" name="zd13" id="input1" lay-verify="" autocomplete="off" placeholder="" class="layui-input" style="display: initial;width: 26.5%;" >
            <button type="button" class="layui-btn" id="test4"><i class="layui-icon"></i>在线预览</button>
            <span class="ylbt" onclick="window.location.href = file + '复工服务表.docx';"><img src="./img/ykya.png" width="28" height="28" alt="样例"/><span style="position: relative;top: 5px;">&nbsp;复工服务表样例</span></span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">企业疫情防控预案</label>
        <div class="layui-input-block">
            <input type="text" name="zd14" id="input2" lay-verify="" autocomplete="off" placeholder="" class="layui-input" style="display: initial;width: 26.5%;" >
            <button type="button" class="layui-btn" id="test5"><i class="layui-icon"></i>在线预览</button>
            <span class="ylbt" onclick="window.location.href = file + '企业疫情防控样例.docx';"><img src="./img/ykya.png" width="28" height="28" alt="样例"/><span style="position: relative;top: 5px;">&nbsp;企业疫情防控预案样例</span></span>
        </div>
    </div>
   <!-- <div class="layui-form-item">
        <label class="layui-form-label">企业防护物资储备情况</label>
        <div class="layui-input-block">
            <input type="text" name="zd15" id="input3" lay-verify="title" autocomplete="off" placeholder="" class="layui-input" style="display: initial;width: 26.5%;" >
            <button type="button" class="layui-btn" id="test6"><i class="layui-icon"></i>下载</button>
        </div>
    </div>-->
<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label">承诺书</label>-->
<!--        <div class="layui-input-block">-->
<!--            <input type="text" name="zd16" id="input4" lay-verify="title" autocomplete="off" placeholder="" class="layui-input" style="display: initial;width: 26.5%;" >-->
<!--            <button type="button" class="layui-btn" id="test7"><i class="layui-icon"></i>在线预览</button>-->
<!--            <span class="ylbt" onclick="window.location.href = file + '企业疫情防控承诺书模板.docx';"><img src="./img/ykya.png" width="28" height="28" alt="样例"/><span style="position: relative;top: 5px;">&nbsp;承诺书样例</span></span>-->
<!--        </div>-->
<!--    </div>-->

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">物资报备日期</label>
            <div class="layui-input-block">
                <input type="text" name="zd25" lay-verify="title" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">是否有应急药品</label>
            <div class="layui-input-block">
                <div style="width: 182px;">
                    <input type="radio" name="zd26" value="是" title="是">
                    <input type="radio" name="zd26" value="否" title="否" checked>
                </div>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">口罩数量（个）</label>
            <div class="layui-input-block">
                <input type="text" id="zd27" name="zd27" lay-verify="title" autocomplete="off" placeholder="请输入口罩数量（个）" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">口罩可用天数（天）</label>
            <div class="layui-input-block">
                <input type="text" id="zd28" name="zd28" lay-verify="title" autocomplete="off" placeholder="请输入口罩可用天数（天）" class="layui-input">
            </div>
        </div>

    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">75%酒精数量（ml）</label>
            <div class="layui-input-block">
                <input type="text" id="zd29" name="zd29" lay-verify="title" autocomplete="off" placeholder="请输75%酒精量（ml）" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">75%酒精可用天数（天）</label>
            <div class="layui-input-block">
                <input type="text" id="zd30" name="zd30" lay-verify="title" autocomplete="off" placeholder="请输入75%酒精可用天数（天）" class="layui-input">
            </div>
        </div>

    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">橡胶手套（双）</label>
            <div class="layui-input-block">
                <input type="text" id="zd31" name="zd31" lay-verify="title" autocomplete="off" placeholder="请输入橡胶手套（双）" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">橡胶手套可用天数（天）</label>
            <div class="layui-input-block">
                <input type="text" id="zd32" name="zd32" lay-verify="title" autocomplete="off" placeholder="请输入橡胶手套可用天数（天）" class="layui-input">
            </div>
        </div>

    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">肥皂数量（块）</label>
            <div class="layui-input-block">
                <input type="text" id="zd33" name="zd33" lay-verify="title" autocomplete="off" placeholder="请输入肥皂数量（块）" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">肥皂可用天数（天）</label>
            <div class="layui-input-block">
                <input type="text" id="zd34" name="zd34" lay-verify="title" autocomplete="off" placeholder="请输入肥皂可用天数（天）" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">测温仪器数量（个）</label>
            <div class="layui-input-block">
                <input type="text" id="zd35" name="zd35" lay-verify="title" autocomplete="off" placeholder="请输入测温仪器数量（个）" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">测温仪器可用天数（天）</label>
            <div class="layui-input-block">
                <input type="text" id="zd36" name="zd36" lay-verify="title" autocomplete="off" placeholder="请输入测温仪器可用天数（天）" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">84消毒液量（ml）</label>
            <div class="layui-input-block">
                <input type="text" id="zd37" name="zd37" lay-verify="title" autocomplete="off" placeholder="请输入84消毒液量（ml）" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">84消毒液可用天数（天）</label>
            <div class="layui-input-block">
                <input type="text" id="zd38" name="zd38" lay-verify="title" autocomplete="off" placeholder="请输入84消毒液可用天数（天）" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">消毒洗手液量（ml）</label>
            <div class="layui-input-block">
                <input type="text" id="zd39" name="zd39" lay-verify="title" autocomplete="off" placeholder="请输入消毒洗手液量（ml）" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">84消毒液可用天数（天）</label>
            <div class="layui-input-block">
                <input type="text" id="zd40" name="zd40" lay-verify="title" autocomplete="off" placeholder="请输入消毒洗手液可用天数（天）" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">企业防护物资储备情况</label>
        <div class="layui-input-block">
            <input type="text" name="zd24" id="input55" lay-verify="title" placeholder="" autocomplete="off" placeholder="" class="layui-input" style="display: initial;width: 26.5%;" >
            <button type="button" class="layui-btn" id="test55"><i class="layui-icon"></i>在线预览</button>
            <span class="ylbt" onclick="window.location.href = file + '企业防护物资储备情况.docx';"><img src="./img/ykya.png" width="28" height="28" alt="样例"/><span style="position: relative;top: 5px;">&nbsp;企业防护物资储备情况</span></span>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">复工人员登记表</label>
        <div class="layui-input-block">
            <input type="text" name="zd41" id="input41" lay-verify="title" placeholder="允许上传大小为2M" autocomplete="off" placeholder="" class="layui-input" style="display: initial;width: 26.5%;" >
            <button type="button" class="layui-btn" id="test41"><i class="layui-icon"></i>在线预览</button>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">贵单位在复工过程中是否存在难点或问题</label>
        <div class="layui-input-block">
            <input type="text" id="zd88" name="zd88" lay-verify="" autocomplete="off" placeholder="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item" style="display: none">
        <label class="layui-form-label">单位出入口照片</label>
        <div class="layui-upload">
            <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;width: 30%; margin-left: 190px">
                预览图：
                <div class="layui-upload-list" id="demo5"></div>
            </blockquote>
        </div>
    </div>
    <div class="layui-form-item" style="display: none">
        <label class="layui-form-label">办公区照片</label>
        <div class="layui-upload">
            <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;width: 30%; margin-left: 190px">
                预览图：
                <div class="layui-upload-list" id="demo6"></div>
            </blockquote>
        </div>
    </div>
    <div class="layui-form-item" style="display: none">
        <label class="layui-form-label">食堂照片</label>
        <div class="layui-upload">
            <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;width: 30%; margin-left: 190px">
                预览图：
                <div class="layui-upload-list" id="demo7"></div>
            </blockquote>
        </div>
    </div>
    <div class="layui-form-item" style="display: none">
        <label class="layui-form-label">应急物资照片</label>
        <div class="layui-upload">
            <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;width: 30%; margin-left: 190px">
                预览图：
                <div class="layui-upload-list" id="demo8"></div>
            </blockquote>
        </div>
    </div>
    <div class="layui-form-item" style="display: none">
        <label class="layui-form-label">物资订单照片</label>
        <div class="layui-upload">
            <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;width: 30%; margin-left: 190px">
                预览图：
                <div class="layui-upload-list" id="demo9"></div>
            </blockquote>
        </div>
    </div>
</form>



</ul>
<div id="img-preview" style="display: none">

</div>
<script src="layui/layui.js" charset="utf-8"></script>
<script src="js/constants.js"></script>
<script src="js/0_common/jquery.min.js"></script>
<script src="layui/jquery.serializejson.min.js"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    var  id=getQueryString("id")
    var ctx = Constants.path;

    $("#ggyqyg").mouseover(function () {
        document.getElementById('ggyqwz').style.display=''
    }).mouseout(function () {
        document.getElementById('ggyqwz').style.display='none'
    });

    $("#ggyqfk").mouseover(function () {
        document.getElementById('ggyqfkwz').style.display=''
    }).mouseout(function () {
        document.getElementById('ggyqfkwz').style.display='none'
    });

    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r !== null)
            return unescape(r[2]);
        return null;
    }
    var layer;
    layui.use(['form'], function(){
        layer = layui.layer;
        $.ajax({
            type: "get",
            url: ctx + "pb/qysqbs/"+id,
            success: function(r) {
                var d = r.data;
                if (r.code == "200"){
                    f(d.zd17,"demo5")
                    f(d.zd18,"demo6")
                    f(d.zd19,"demo7")
                    f(d.zd20,"demo8")
                    f(d.zd21,"demo9")
                    layui.form.val("form-test", d);
                }
            }
        })
    })

    function gb(){
        layer.closeAll();
    }

    var file = ctx+"FUGONGP/"
    function isAssetTypeAnImage(ext) {
        return [
            'png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff'].
        indexOf(ext.toLowerCase()) !== -1;
    }
    $("#test4").click(function () {
        var fileName = $("input[name='zd13']").val();
        previewImg(fileName)
       /* if (fileName != ""){

            var index= fileName.lastIndexOf(".");
//获取后缀
            var ext = fileName.substr(index+1);
            if(isAssetTypeAnImage(ext)==true){
                window.location.href = ctx + "downloadsource?name="+fileName;
                // $.ajax({
                //     type: "post",
                //     url: ctx + "downloadsource?name="+fileName,
                //     success: function (r) {
                //
                //     }
                // })
            }else{
                window.location.href = file + fileName;
            }
        }*/
    })
    $("#test5").click(function () {
        var fileName = $("input[name='zd14']").val();
        previewImg(fileName);
        /*if (fileName != ""){
            // window.location.href = file + fileName;
            var index= fileName.lastIndexOf(".");
//获取后缀
            var ext = fileName.substr(index+1);
            if(isAssetTypeAnImage(ext)==true){
                window.location.href = ctx + "downloadsource?name="+fileName;
                // $.ajax({
                //     type: "post",
                //     url: ctx + "downloadsource?name="+fileName,
                //     success: function (r) {
                //
                //     }
                // })
            }else{
                window.location.href = file + fileName;
            }
        }*/
    })
    $("#test6").click(function () {
        var fileName = $("input[name='zd15']").val();
        if (fileName != ""){
            // window.location.href = file + fileName;
            var index= fileName.lastIndexOf(".");
//获取后缀
            var ext = fileName.substr(index+1);
            if(isAssetTypeAnImage(ext)==true){
                window.location.href = ctx + "downloadsource?name="+fileName;
                // $.ajax({
                //     type: "post",
                //     url: ctx + "downloadsource?name="+fileName,
                //     success: function (r) {
                //
                //     }
                // })
            }else{
                window.location.href = file + fileName;
            }
        }
    })
//     $("#test7").click(function () {
//         var fileName = $("input[name='zd16']").val();
//         previewImg(fileName);
//        /* if (fileName != ""){
//             // window.location.href = file + fileName;
//             var index= fileName.lastIndexOf(".");
// //获取后缀
//             var ext = fileName.substr(index+1);
//             if(isAssetTypeAnImage(ext)==true){
//                 window.location.href = ctx + "downloadsource?name="+fileName;
//                 // $.ajax({
//                 //     type: "post",
//                 //     url: ctx + "downloadsource?name="+fileName,
//                 //     success: function (r) {
//                 //
//                 //     }
//                 // })
//             }else{
//                 window.location.href = file + fileName;
//             }
//         }*/
//     })
    $("#test41").click(function () {
        var fileName = $("input[name='zd41']").val();
        previewImg(fileName);
       /* if (fileName != ""){
            // window.location.href = file + fileName;
            var index= fileName.lastIndexOf(".");
//获取后缀
            var ext = fileName.substr(index+1);
            if(isAssetTypeAnImage(ext)==true){
                window.location.href = ctx + "downloadsource?name="+fileName;
                // $.ajax({
                //     type: "post",
                //     url: ctx + "downloadsource?name="+fileName,
                //     success: function (r) {
                //
                //     }
                // })
            }else{
                window.location.href = file + fileName;
            }
        }*/
    })
    $("#test55").click(function ()
    {
        var fileName = $("input[name='zd24']").val();
        previewImg(fileName);
       /* if (fileName != ""){
            // window.location.href = file + fileName;
            var index= fileName.lastIndexOf(".");
//获取后缀
            var ext = fileName.substr(index+1);
            if(isAssetTypeAnImage(ext)==true){
                window.location.href = ctx + "downloadsource?name="+fileName;
                // $.ajax({
                //     type: "post",
                //     url: ctx + "downloadsource?name="+fileName,
                //     success: function (r) {
                //
                //     }
                // })
            }else{
                window.location.href = file + fileName;
            }
        }*/
    })
    function f(urls,id) {
        if (urls != null && urls != ""){
        var url = urls.split(",");
        $.each(url,function (i,u) {
            $('#'+id).append('<img src="'+ file + u +'" alt="'+ file + u +'" style = "width: 200px;" class="layui-upload-img">')
        })
        }
    }

    function previewImg(fileName) {
        if (!fileName) {
            return;
        }
        if (/(.*)\.(jpg|bmp|gif|ico|pcx|jpeg|tif|png|raw|tga)$/.test(fileName)) {
            var html = "<ul id='img-previewer-container'><li><img src='" + file + fileName + "' alt=''></li></ul>";
            $("#img-preview").html(html);
            var viewer = new Viewer(document.getElementById("img-previewer-container"), {
                inline: false,
                url: 'data-original',
                zoomRatio: 0.4,
                button: true,
                title: false,
                keyboard: false,
                toolbar: {
                    zoomIn: 1,
                    zoomOut: 1,
                    oneToOne: 1,
                    reset: 1,
                    prev: 0,
                    play: 0,
                    next: 0,
                    rotateLeft: 1,
                    rotateRight: 1,
                    flipHorizontal: 1,
                    flipVertical: 1,
                }
            });
            viewer.view(0);
        } else {
            window.open(file + fileName);
        }
    }

</script>

</body>
</html>